package com.vita.bduck.logger;

public final class LoggerFactory {

  static AndroidLoggerFactory TEMP_FACTORY = null;


    /**
     *   不被实例化
     */
  private LoggerFactory() {
  }

  /**
   *返回一个 从抽象工厂获取具体工厂类，再获取Log对象
   *
   * @param name
   *          The name of the logger.
   * @return logger
   */
  public static Log getLogger(String name) {
    ILoggerFactory iLoggerFactory = getILoggerFactory();
    return iLoggerFactory.getLogger(name);
  }


  public static Log getLogger(Class clazz) {
    return getLogger(clazz.getName());
  }


  public static ILoggerFactory getILoggerFactory() {

      ILoggerFactory factory = null;
      //以后加入各种Logger工厂的判断
      //.....

      if (TEMP_FACTORY == null)
          TEMP_FACTORY = new AndroidLoggerFactory();

      return TEMP_FACTORY;



  }
}
